package com.lpfy.dtxc.feature;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.widget.Toast;
import androidx.annotation.Nullable;

import com.tencent.smtt.sdk.QbSdk;

public class X5WebViewActivity extends BaseWebViewActivity {

    private static final String M_TAG = "X5WebViewActivity";

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        this.setTAG(M_TAG);
        super.onCreate(savedInstanceState);
        startDefinedUrl();
    }

    @Override
    protected void initWebView() {
        super.initWebView();
        Toast.makeText(this, mWebView.getIsX5Core() ?
                "X5内核: " + QbSdk.getTbsVersion(this) : "SDK系统内核" , Toast.LENGTH_SHORT).show();
    }

    private void startDefinedUrl() {
        Intent intent = getIntent();
        if (intent != null) {
            String url = intent.getStringExtra("url");
            if (mWebView != null) {
                mWebView.loadUrl("https://lingsy.oss-cn-beijing.aliyuncs.com/%E6%B5%85%E8%B0%88%E3%80%8A%E8%AF%97%E7%BB%8F%E3%80%8B%E4%B8%AD%E7%94%9F%E5%91%BD%E6%84%8F%E8%B1%A1%E7%9A%84%E6%83%85%E6%84%9F%E5%86%85%E6%B6%B5%E4%B8%8E%E4%BB%B7%E5%80%BC_%E9%A1%BE%E6%99%B4%E5%B7%9D.pdf");
            }
        } else {
            Log.i(M_TAG, "Intent is null");
        }
    }
}
